
// 获得 bigint 类型的值
let first = 123456789n ; // 末尾追加 n 后缀
console.log( first , typeof( first ) );

// 可以将 BigInt 当作转换函数来使用
let second = BigInt( '0xFFFFFFFFFFFF' );
console.log( second , typeof( second ) );

console.log( '- - - - - - - - - - - - - - - - - - - - -' );

// let third = new BigInt( '0x123456789ABCDEF' ); // TypeError: BigInt is not a constructor

let third = BigInt( '0x123456789ABCDEF' ) ;
console.log( third , typeof( third ) );

// 借助于 Object函数 可以将 bigint 值 包裹到 一个 BigInt实例 中
let fourth = Object( third ); // 手动装箱
console.log( fourth , typeof( fourth ) );

let fifth = fourth.valueOf();
console.log( fifth , typeof( fifth ) );

console.log( third === fifth );